package com.aishua.fire.jpa.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.aishua.fire.common.anno.EntityDesc;

import lombok.Data;

@EntityDesc(desc="权限表")
@Entity
@Data
public class Perm implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public Perm() {
	}
	
	public Perm(String permName,String permDesc,String requestMethod,Date createDate,String status) {
		super();
		this.permName = permName;
		this.permDesc = permDesc;
		this.requestMethod = requestMethod;
		this.createDate = createDate;
		this.status = status;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(nullable = false,columnDefinition="bigint COMMENT '主键，自动生成'")
	private long permId;
	
	@Column(nullable = false,columnDefinition="varchar(128) COMMENT '权限资源名称'")
	private String permName;
	
	@Column(nullable = true,columnDefinition="varchar(128) COMMENT '权限资源描述信息'")
	private String permDesc;
	
	@Column(nullable = false,columnDefinition="varchar(8) COMMENT '若为url类型权限,对应的权限类型POST,GET,PUT,DELETE'")
	private String requestMethod;
	
	@Column(nullable = false,columnDefinition="DATETIME COMMENT '数据添加时间'")
	private Date createDate;
	
	@Column(nullable = false,columnDefinition="varchar(4) COMMENT '软删除状态'")
	private String status;
	
	@Column(nullable = false,columnDefinition="varchar(2) COMMENT '权限类型,0为url权限,1为数据库权限'")
	private String type;
	
	@Column(nullable = true,columnDefinition="varchar(64) COMMENT '小模块名'")
	private String moduleName;
	
	@Column(nullable = true,columnDefinition="varchar(64) COMMENT '大模块名'")
	private String totalModuleName;
	
	@Column(nullable = true,columnDefinition="varchar(256) COMMENT '所在类名'")
	private String className;
	
	@Column(nullable = true,columnDefinition="varchar(8) COMMENT '是否为白名单,0为需要权限校验,1为直接放行'")
	private String isBlank;
	
	@Column(nullable = true,columnDefinition="varchar(8) COMMENT '没有验证权限,0为需要权限校验,1为直接放行'")
	private String noValidate;
}
